<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <!-- 定义挂载点 -->
    <div id="app">
        <!-- 隐式传递事件对象，么有写括号的情况下，第一个参数默认就是event -->
        <p><button @click="getEvent">获取事件对象</button></p>

        <!-- 显示传递事件对象 -->
        <p><button @click="getEvent2($event,'你好啊')">获取事件对象</button></p>
    </div>

    <script>
        new Vue({
            //挂载点
            el:"#app",
            //数据
            data:{},
            //方法
            methods:{
                getEvent(e){
                    console.log(e);
                },
                getEvent2(e,str){
                    console.log(e);
                    console.log(str);
                }
            }
        })

      
    </script>
</body>
</html>